package com.kgc.manager.controller;

import com.kgc.entity.TbItem;
import com.kgc.manger.service.ItemService;
import com.kgc.utils.ResultTable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("item")
public class ItemController {

  @Autowired
  private ItemService itemService;

  @RequestMapping("list")
  @ResponseBody
    public ResultTable list(
          @RequestParam(value = "page",defaultValue = "1",required = false) int page,
          @RequestParam(value = "limit",defaultValue = "10",required = false)int limit,
          Long cid
  ){
      return itemService.findAll(page,limit,cid);
  }
}
